package Visualizator;

import java.awt.Component;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.JPanel;

import Data.CellData;
import Data.RobotData;
import Data.VisualizationData;

public class vGui {

	private JFrame fream;
	private JPanel panel;
	private JPanel panelData;
	
	public Map map = new Map();
	
	private VisualizationData data;
	
	public vGui()
	{
		fream = new JFrame("Visualizator");	
	}
	 
	public vGui(String name)
	{
		fream = new JFrame(name);
	}
	
	public void PassData(VisualizationData data)
	{
		this.data = data;
		PassGridData(data.grid);
		PassRobotData(data.robot);
		map.repaint();
	}
	
	public void PassGridData( CellData[][] grid)
	{
		map.grid = grid;
	}
	
	public void PassRobotData ( List<RobotData> robots)
	{
		map.robots = robots;
	}
	
	public void DrawGui()
	{
		fream.setMinimumSize(new Dimension(700, 700));
		panel = new  JPanel();
		
		//panelData = new JPanel();
		
		//panelData = 
		
		panel.add(map);
		map.repaint();
		
		fream.add(panel);
		
		
		fream.pack();
		fream.setVisible(true);
	}
	
	
	
	

}


